<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /Users/paulross/dev/linux/linux-3.13/include/linux/compiler-gcc4.h</title>
  </head>
  <body>
    <h1>File: /Users/paulross/dev/linux/linux-3.13/include/linux/compiler-gcc4.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="False">       1:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_X19MSU5VWF9DT01QSUxFUl9IXzA_"><span class="b">__LINUX_COMPILER_H</span></a>
<a name="2" /><span class="False">       2:</span> <span class="f">#</span><span class="n">error</span> <span class="e">&quot;Please don&apos;t include &lt;linux/compiler-gcc4.h&gt; directly, include &lt;linux/compiler.h&gt; instead.&quot;</span>
<a name="3" /><span class="True">       3:</span> <span class="f">#</span><span class="n">endif</span>
<a name="4" /><span class="True">       4:</span> 
<a name="5" /><span class="True">       5:</span> <span class="k">/* GCC 4.1.[01] miscompiles __weak */</span>
<a name="6" /><span class="True">       6:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_X19LRVJORUxfX18w"><span class="b">__KERNEL__</span></a>
<a name="7" /><span class="False">       7:</span> <span class="f">#</span> <span class="n">if</span> <a href="cpu.c_macros_ref.html#_R0NDX1ZFUlNJT05fMA__"><span class="b">GCC_VERSION</span></a> <span class="f">&gt;=</span> <span class="c">40100</span> <span class="f">&amp;&amp;</span>  <a href="cpu.c_macros_ref.html#_R0NDX1ZFUlNJT05fMA__"><span class="b">GCC_VERSION</span></a> <span class="f">&lt;=</span> <span class="c">40101</span>
<a name="8" /><span class="False">       8:</span> <span class="f">#</span>  <span class="n">error</span> <span class="b">Your</span> <span class="b">version</span> <span class="b">of</span> <span class="b">gcc</span> <span class="b">miscompiles</span> <span class="b">the</span> <a href="cpu.c_macros_ref.html#_X193ZWFrXzA_"><span class="b">__weak</span></a> <span class="b">directive</span>
<a name="9" /><span class="True">       9:</span> <span class="f">#</span> <span class="n">endif</span>
<a name="10" /><span class="True">      10:</span> <span class="f">#</span><span class="n">endif</span>
<a name="11" /><span class="True">      11:</span> 
<a name="12" /><span class="True">      12:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_X191c2VkXzA_"><span class="b">__used</span></a>            <span class="b">__attribute__</span><span class="f">(</span><span class="f">(</span><span class="b">__used__</span><span class="f">)</span><span class="f">)</span>
<a name="13" /><span class="True">      13:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_X19tdXN0X2NoZWNrXzE_"><span class="b">__must_check</span></a>         <span class="b">__attribute__</span><span class="f">(</span><span class="f">(</span><span class="b">warn_unused_result</span><span class="f">)</span><span class="f">)</span>
<a name="14" /><span class="True">      14:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_X19jb21waWxlcl9vZmZzZXRvZl8w"><span class="b">__compiler_offsetof</span></a><span class="f">(</span><span class="b">a</span><span class="f">,</span><span class="b">b</span><span class="f">)</span> <span class="b">__builtin_offsetof</span><span class="f">(</span><span class="b">a</span><span class="f">,</span><span class="b">b</span><span class="f">)</span>
<a name="15" /><span class="True">      15:</span> 
<a name="16" /><span class="False">      16:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_R0NDX1ZFUlNJT05fMA__"><span class="b">GCC_VERSION</span></a> <span class="f">&gt;=</span> <span class="c">40100</span> <span class="f">&amp;&amp;</span> <a href="cpu.c_macros_ref.html#_R0NDX1ZFUlNJT05fMA__"><span class="b">GCC_VERSION</span></a> <span class="f">&lt;</span> <span class="c">40600</span>
<a name="17" /><span class="False">      17:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_ref.html#_X19jb21waWxldGltZV9vYmplY3Rfc2l6ZV8w"><span class="b">__compiletime_object_size</span></a><span class="f">(</span><span class="b">obj</span><span class="f">)</span> <span class="b">__builtin_object_size</span><span class="f">(</span><span class="b">obj</span><span class="f">,</span> <span class="c">0</span><span class="f">)</span>
<a name="18" /><span class="True">      18:</span> <span class="f">#</span><span class="n">endif</span>
<a name="19" /><span class="True">      19:</span> 
<a name="20" /><span class="False">      20:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_R0NDX1ZFUlNJT05fMA__"><span class="b">GCC_VERSION</span></a> <span class="f">&gt;=</span> <span class="c">40300</span>
<a name="21" /><span class="False">      21:</span> <span class="k">/* Mark functions as cold. gcc will assume any path leading to a call</span>
<a name="22" /><span class="False">      22:</span> <span class="k">   to them will be unlikely.  This means a lot of manual unlikely()s</span>
<a name="23" /><span class="False">      23:</span> <span class="k">   are unnecessary now for any paths leading to the usual suspects</span>
<a name="24" /><span class="False">      24:</span> <span class="k">   like BUG(), printk(), panic() etc. [but let&apos;s keep them for now for</span>
<a name="25" /><span class="False">      25:</span> <span class="k">   older compilers]</span>
<a name="26" /><span class="False">      26:</span> <span class="k"></span>
<a name="27" /><span class="False">      27:</span> <span class="k">   Early snapshots of gcc 4.3 don&apos;t support this and we can&apos;t detect this</span>
<a name="28" /><span class="False">      28:</span> <span class="k">   in the preprocessor, but we can live with this because they&apos;re unreleased.</span>
<a name="29" /><span class="False">      29:</span> <span class="k">   Maketime probing would be overkill here.</span>
<a name="30" /><span class="False">      30:</span> <span class="k"></span>
<a name="31" /><span class="False">      31:</span> <span class="k">   gcc also has a __attribute__((__hot__)) to move hot functions into</span>
<a name="32" /><span class="False">      32:</span> <span class="k">   a special section, but I don&apos;t see any sense in this right now in</span>
<a name="33" /><span class="False">      33:</span> <span class="k">   the kernel context */</span>
<a name="34" /><span class="False">      34:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_X19jb2xkXzA_"><span class="b">__cold</span></a>            <span class="b">__attribute__</span><span class="f">(</span><span class="f">(</span><span class="b">__cold__</span><span class="f">)</span><span class="f">)</span>
<a name="35" /><span class="False">      35:</span> 
<a name="36" /><span class="False">      36:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_X19VTklRVUVfSURfMA__"><span class="b">__UNIQUE_ID</span></a><span class="f">(</span><span class="b">prefix</span><span class="f">)</span> <a href="cpu.c_macros_noref.html#_X19QQVNURV8w"><span class="b">__PASTE</span></a><span class="f">(</span><a href="cpu.c_macros_noref.html#_X19QQVNURV8w"><span class="b">__PASTE</span></a><span class="f">(</span><span class="b">__UNIQUE_ID_</span><span class="f">,</span> <span class="b">prefix</span><span class="f">)</span><span class="f">,</span> <span class="b">__COUNTER__</span><span class="f">)</span>
<a name="37" /><span class="False">      37:</span> 
<a name="38" /><span class="False">      38:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">__CHECKER__</span>
<a name="39" /><span class="False">      39:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_ref.html#_X19jb21waWxldGltZV93YXJuaW5nXzA_"><span class="b">__compiletime_warning</span></a><span class="f">(</span><span class="b">message</span><span class="f">)</span> <span class="b">__attribute__</span><span class="f">(</span><span class="f">(</span><span class="b">warning</span><span class="f">(</span><span class="b">message</span><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="40" /><span class="False">      40:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_ref.html#_X19jb21waWxldGltZV9lcnJvcl8w"><span class="b">__compiletime_error</span></a><span class="f">(</span><span class="b">message</span><span class="f">)</span> <span class="b">__attribute__</span><span class="f">(</span><span class="f">(</span><span class="b">error</span><span class="f">(</span><span class="b">message</span><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="41" /><span class="False">      41:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* __CHECKER__ */</span>
<a name="42" /><span class="True">      42:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* GCC_VERSION &gt;= 40300 */</span>
<a name="43" /><span class="True">      43:</span> 
<a name="44" /><span class="False">      44:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_R0NDX1ZFUlNJT05fMA__"><span class="b">GCC_VERSION</span></a> <span class="f">&gt;=</span> <span class="c">40500</span>
<a name="45" /><span class="False">      45:</span> <span class="k">/*</span>
<a name="46" /><span class="False">      46:</span> <span class="k"> * Mark a position in code as unreachable.  This can be used to</span>
<a name="47" /><span class="False">      47:</span> <span class="k"> * suppress control flow warnings after asm blocks that transfer</span>
<a name="48" /><span class="False">      48:</span> <span class="k"> * control elsewhere.</span>
<a name="49" /><span class="False">      49:</span> <span class="k"> *</span>
<a name="50" /><span class="False">      50:</span> <span class="k"> * Early snapshots of gcc 4.5 don&apos;t support this and we can&apos;t detect</span>
<a name="51" /><span class="False">      51:</span> <span class="k"> * this in the preprocessor, but we can live with this because they&apos;re</span>
<a name="52" /><span class="False">      52:</span> <span class="k"> * unreleased.  Really, we need to have autoconf for the kernel.</span>
<a name="53" /><span class="False">      53:</span> <span class="k"> */</span>
<a name="54" /><span class="False">      54:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_dW5yZWFjaGFibGVfMA__"><span class="b">unreachable</span></a><span class="f">(</span><span class="f">)</span> <span class="b">__builtin_unreachable</span><span class="f">(</span><span class="f">)</span>
<a name="55" /><span class="False">      55:</span> 
<a name="56" /><span class="False">      56:</span> <span class="k">/* Mark a function definition as prohibited from being cloned. */</span>
<a name="57" /><span class="False">      57:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_X19ub2Nsb25lXzA_"><span class="b">__noclone</span></a>    <span class="b">__attribute__</span><span class="f">(</span><span class="f">(</span><span class="b">__noclone__</span><span class="f">)</span><span class="f">)</span>
<a name="58" /><span class="False">      58:</span> 
<a name="59" /><span class="True">      59:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* GCC_VERSION &gt;= 40500 */</span>
<a name="60" /><span class="True">      60:</span> 
<a name="61" /><span class="False">      61:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_R0NDX1ZFUlNJT05fMA__"><span class="b">GCC_VERSION</span></a> <span class="f">&gt;=</span> <span class="c">40600</span>
<a name="62" /><span class="False">      62:</span> <span class="k">/*</span>
<a name="63" /><span class="False">      63:</span> <span class="k"> * Tell the optimizer that something else uses this function or variable.</span>
<a name="64" /><span class="False">      64:</span> <span class="k"> */</span>
<a name="65" /><span class="False">      65:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_X192aXNpYmxlXzA_"><span class="b">__visible</span></a> <span class="b">__attribute__</span><span class="f">(</span><span class="f">(</span><span class="b">externally_visible</span><span class="f">)</span><span class="f">)</span>
<a name="66" /><span class="True">      66:</span> <span class="f">#</span><span class="n">endif</span>
<a name="67" /><span class="True">      67:</span> 
<a name="68" /><span class="True">      68:</span> <span class="k">/*</span>
<a name="69" /><span class="True">      69:</span> <span class="k"> * GCC &apos;asm goto&apos; miscompiles certain code sequences:</span>
<a name="70" /><span class="True">      70:</span> <span class="k"> *</span>
<a name="71" /><span class="True">      71:</span> <span class="k"> *   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670</span>
<a name="72" /><span class="True">      72:</span> <span class="k"> *</span>
<a name="73" /><span class="True">      73:</span> <span class="k"> * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.</span>
<a name="74" /><span class="True">      74:</span> <span class="k"> * Fixed in GCC 4.8.2 and later versions.</span>
<a name="75" /><span class="True">      75:</span> <span class="k"> *</span>
<a name="76" /><span class="True">      76:</span> <span class="k"> * (asm goto is automatically volatile - the naming reflects this.)</span>
<a name="77" /><span class="True">      77:</span> <span class="k"> */</span>
<a name="78" /><span class="True">      78:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_R0NDX1ZFUlNJT05fMA__"><span class="b">GCC_VERSION</span></a> <span class="f">&lt;=</span> <span class="c">40801</span>
<a name="79" /><span class="True">      79:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_noref.html#_YXNtX3ZvbGF0aWxlX2dvdG9fMA__"><span class="b">asm_volatile_goto</span></a><span class="f">(</span><span class="b">x</span><span class="f">...</span><span class="f">)</span>    <span class="m">do</span> <span class="f">{</span> <span class="m">asm</span> <span class="m">goto</span><span class="f">(</span><span class="b">x</span><span class="f">)</span><span class="f">;</span> <span class="m">asm</span> <span class="f">(</span><span class="e">&quot;&quot;</span><span class="f">)</span><span class="f">;</span> <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="80" /><span class="False">      80:</span> <span class="f">#</span><span class="n">else</span>
<a name="81" /><span class="False">      81:</span> <span class="f">#</span> <span class="n">define</span> <a href="cpu.c_macros_noref.html#_YXNtX3ZvbGF0aWxlX2dvdG9fMA__"><span class="b">asm_volatile_goto</span></a><span class="f">(</span><span class="b">x</span><span class="f">...</span><span class="f">)</span>    <span class="m">do</span> <span class="f">{</span> <span class="m">asm</span> <span class="m">goto</span><span class="f">(</span><span class="b">x</span><span class="f">)</span><span class="f">;</span> <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="82" /><span class="True">      82:</span> <span class="f">#</span><span class="n">endif</span>
<a name="83" /><span class="True">      83:</span> 
<a name="84" /><span class="True">      84:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX0FSQ0hfVVNFX0JVSUxUSU5fQlNXQVBfMA__"><span class="b">CONFIG_ARCH_USE_BUILTIN_BSWAP</span></a>
<a name="85" /><span class="False">      85:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_R0NDX1ZFUlNJT05fMA__"><span class="b">GCC_VERSION</span></a> <span class="f">&gt;=</span> <span class="c">40400</span>
<a name="86" /><span class="False">      86:</span> <span class="f">#</span><span class="n">define</span> <span class="b">__HAVE_BUILTIN_BSWAP32__</span>
<a name="87" /><span class="False">      87:</span> <span class="f">#</span><span class="n">define</span> <span class="b">__HAVE_BUILTIN_BSWAP64__</span>
<a name="88" /><span class="True">      88:</span> <span class="f">#</span><span class="n">endif</span>
<a name="89" /><span class="False">      89:</span> <span class="f">#</span><span class="n">if</span> <a href="cpu.c_macros_ref.html#_R0NDX1ZFUlNJT05fMA__"><span class="b">GCC_VERSION</span></a> <span class="f">&gt;=</span> <span class="c">40800</span> <span class="f">||</span> <span class="f">(</span><span class="b">defined</span><span class="f">(</span><span class="b">__powerpc__</span><span class="f">)</span> <span class="f">&amp;&amp;</span> <a href="cpu.c_macros_ref.html#_R0NDX1ZFUlNJT05fMA__"><span class="b">GCC_VERSION</span></a> <span class="f">&gt;=</span> <span class="c">40600</span><span class="f">)</span>
<a name="90" /><span class="False">      90:</span> <span class="f">#</span><span class="n">define</span> <span class="b">__HAVE_BUILTIN_BSWAP16__</span>
<a name="91" /><span class="True">      91:</span> <span class="f">#</span><span class="n">endif</span>
<a name="92" /><span class="True">      92:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* CONFIG_ARCH_USE_BUILTIN_BSWAP */</span>
<a name="93" /><span class="True">      93:</span> </pre>
  </body>
</html>
